#include <network\streamingServer.h>

#include <boost/thread.hpp>
#include <boost/shared_ptr.hpp>
#include <vector>

int main(int argc, char* argv[])
{
  try
  {
    boost::asio::io_service io_service;

    streamingServer s(io_service, 9000);

    //io_service.run();
    
    // Create a pool of threads to run all of the io_services.
    std::vector<boost::shared_ptr<boost::thread> > threads;
    for (std::size_t i = 0; i < 16; ++i) {
      boost::shared_ptr<boost::thread> thread(new boost::thread(
            boost::bind(&boost::asio::io_service::run, &io_service)));
      threads.push_back(thread);
    }

    // Wait for all threads in the pool to exit.
    for (std::size_t i = 0; i < threads.size(); ++i) {
      threads[i]->join();
    }
    
  }
  catch (std::exception& e) {
    #ifdef DEBUG_INFO
    std::cerr << "Exception: " << e.what() << "\n";
    #endif
  }

  return 0;
}


/*
#include <stdlib.h>
#include <stdio.h>
#include <fstream>

#include <streamingServer.h>

int main(int argc, char **argv) {

  streamingServer server;
  return server.run(argc, argv); 
}
*/